<?php

namespace App\Crontab;

use Hyperf\Crontab\Annotation\Crontab;

#[Crontab(name: "Test", rule: "*/5 * * * * *", callback: "execute", enable: "isEnable", memo: "这是一个示例的定时任务")]
class TestCrontab
{
        public function execute()
        {
                echo '5秒定时任务';
                echo date('Y-m-d H:i:s');
                echo PHP_EOL;
                echo PHP_EOL;
        }

        public function isEnable(): bool
        {
                return false;
        }
}
